package cn.SiFuLan.controls;

import cn.SiFuLan.dao.IskuDao;
import cn.SiFuLan.dao.impl.skuDaoImapl;
import cn.SiFuLan.entity.skuEntity;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = "/admin/skuupdate.shtml")
public class skuupdateServlt extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        IskuDao iskuDao=new skuDaoImapl();
        String skuid=request.getParameter("sku_id");
        skuEntity sku=null;
        if(skuid!=null && !skuid.equals("")){
            sku=iskuDao.getall(Integer.parseInt(skuid));
        }
        request.setAttribute("sku",sku);
        request.getRequestDispatcher("skuupdate.jsp").forward(request,response);
    }
}
